package com.qls.web.modules.dt.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qls.core.entity.DtOrderChannels;
import com.qls.web.common.utils.PageUtils;
import com.qls.web.common.utils.Query;
import com.qls.web.modules.dt.dao.DtOrderChannelsDao;
import com.qls.web.modules.dt.service.DtOrderChannelsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * @author doyoung
 */
@Service("orderChannelsService")
public class DtOrderChannelsServiceImpl extends ServiceImpl<DtOrderChannelsDao, DtOrderChannels> implements DtOrderChannelsService {

    @Override
    public Integer getPriorityCount(Integer priority) {
        return baseMapper.getPriorityCount(priority);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DtOrderChannels> page = this.page(
                new Query<DtOrderChannels>().getPage(params),
                new QueryWrapper<DtOrderChannels>()
        );

        return new PageUtils(page);
    }

    @Override
    public DtOrderChannels getByStoreId(Integer storeId) {
        return baseMapper.getByStoreId(storeId);
    }

    @Override
    public DtOrderChannels getByStoreIdAndChanel(Integer storeId, Integer chanel) {
        return baseMapper.getByStoreIdAndChannel(storeId, chanel);
    }

    @Override
    public List<DtOrderChannels> getByChannel() {
        return baseMapper.getByChannel();
    }

    @Override
    public DtOrderChannels getCommissionRate() {
        return baseMapper.getCommissionRate();
    }
}